<!DOCTYPE html>
<html lang="en">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
      name="viewport">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<head>
    <meta charset="UTF-8">
    <title>OA-app与H5交互Demo</title>
    <script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
    <script src="/dist/plugins/vue/vue.js"></script>
    <script src="/dist/js/oaApp.js"></script>
</head>
<body>
<div id="app">
</div>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            userId:getUrlParamObj().userId,
            roleName:''
        },
        methods: {
            goDetail:function () {
                var that = this;
                var param = {
                    screenType: '0',        //默认竖屏0, 横屏1
                    url: 'page/reportForm/tabAppNew.html?userId=' + that.userId,
                    showTitleBar: false,     //是否显示标题栏
                    enableRefresh: false,   //是否启用下拉刷新
                }
                JSBridge.call(ROUTER, 'navigateTo', param)

            },
            getUserInfo: function () {
                var that = this
                axios.post(urlConfig.system.user.getUserViewById,{"id": that.userId
                })
                    .then(function (data) {
                        console.log(data)
                        that.roleName = data.roleName;
                        var str = '1002';
                        if(that.roleName=='大区经理'||that.roleName=='区域经理'){
                            //内部h5跳转
                           that.goDetail();
                        }else{
                            str = '1001';
                            that.goDetail(str);
                        }

                    })
            },
            goDetail:function (str) {
                var param = {
                    param: str
                }
                JSBridge.call(UI, 'paramSend', param, function (res) {
                })
            }
        },
        mounted:function () {
            var that = this;
            //that.getUserInfo();
            that.goDetail('1001');

        }
    })
</script>
</body>
</html>